const redis = require('redis');

const client = redis.createClient({
  host: process.env.REDIS_HOST || '127.0.0.1',
  port: process.env.REDIS_PORT || 6379,
});

client.connect()
.then(() => {
  console.log('✅ Redis 数据库连接成功!');
})
.catch((err) => {
  console.error('❌ Redis 数据库连接失败:', err);
});

module.exports = client;